<% add_decidim_page_title t("title", scope: "decidim.budgets.order.status") %>

<% if @focus_mode %>
  <% content_for :focus_mode, true %>
<% end %>

<%= render layout: "layouts/decidim/shared/layout_center", locals: { columns: 6 } do %>
  <div class="flex flex-col gap-4 items-center text-center mt-12 mb-6">
    <%= success_animation %>

    <h1 class="h1 inline-block">
      <%= t("title", scope: "decidim.budgets.order.status") %>
    </h1>

    <p class="text-xl">
      <%= t("votes_count", scope: "decidim.budgets.order.status", count: current_order.total_projects, budget_name: translated_attribute(current_order.budget.title)) %>

      <br>

      <% if pending_to_vote_budgets.present? %>
        <span class="font-semibold">
          <%= t("pending_to_vote_budgets", scope: "decidim.budgets.order.status", count: pending_to_vote_budgets.count) %>
        </span>
      <% end %>
    </p>
  </div>

  <div class="form__wrapper-block flex-col-reverse xl:flex-row justify-center xl:px-12">
    <%= link_to export_pdf_budget_order_path(current_order.budget), class: "button button__sm lg:button__lg button__transparent-secondary xl:w-1/2" do %>
      <span><%= t("download_vote", scope: "decidim.budgets.order.status") %></span>
      <%= icon "download-line", class: "fill-current" %>
    <% end %>

    <%= link_to budgets_path, class: "button button__sm lg:button__lg button__secondary xl:w-1/2" do %>
      <span>
        <% if pending_to_vote_budgets.present? %>
          <%= t("continue_voting", scope: "decidim.budgets.order.status") %>
        <% else %>
          <%= t("view_votes", scope: "decidim.budgets.order.status", count: current_order.total_projects) %>
        <% end %>
      </span>
      <%= icon "arrow-right-line", class: "fill-current" %>
    <% end %>
  </div>

  <div class="text-center">
    <%= cell "decidim/share_text_widget",
             current_order.budget,
             button_classes: "button button__sm lg:button__lg button__text-secondary",
             button_text: t("share_vote", scope: "decidim.budgets.order.status") %>
  </div>
<% end %>
